﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.Collections;

namespace SchemaMonitor.json
{
    [DataContract]
    public class CFieldSingle : CField
    {
        //Members
        [DataMember(Order = 1)]
        public List<Single> Singles;

        //Constructor   
        public CFieldSingle(CNodeBasic parent, CTag tag, object value) : base(parent, tag)
        {
            this.Value = value;
        }
        //Serialisation Constructors
        private CFieldSingle() { }
        static CFieldSingle() { ProtoBuf.Serializer.PrepareSerializer<CFieldSingle>(); }

        //Must Override
        public override IList List { get { return Singles; } set { Singles = value.Cast<Single>().ToList(); } }
        protected override IList InitList() { return new List<Single>(); }
        protected override IList InitList(object[] array) { return array.Cast<Single>().ToList(); }

    }
}
